Retrieving Database connection information

Does anyone know how to get the current port and server information from dxl? I know i can use getenv() to get the default ones but we have a few different servers that we connect to via different shortcuts with port and server information supplied on the shortcut.

I need to check which port and server the user is one before performing some task.

Thanks,
Steve Valliere
StephenValliere - Tue Sep 27 14:48:21 EDT 2011

Re: Retrieving Database connection information
llandale - Tue Sep 27 15:02:39 EDT 2011

If you add string "DOORS" to your environment variable name, and turn it to upper case, you can retrieve the current actual value. So if you use the "-d" command line switch to re-direct a shortcut to a different database, the following DXL will print different results:
 

string DefDB = getenv("data")
string CurrDB = getenv("DOORSDATA")
string UnkDB  = getenv("doorsData")   // won't work, not all upper case
 
print "Def/Curr/Unk = [" DefDB "]\t[" CurrDB "]\t[" UnkDB "]\n"
if (DefDB != CurrDB) then print "\tusing Command Line Switch Override\n"

 

 

  • Louie


IIRC, using setenv on both the above will have the same effect, modifying "data" in your registry HKEY_Current_User DOORS config value.

 

 

Re: Retrieving Database connection information
StephenValliere - Tue Sep 27 15:10:57 EDT 2011

Thanks Louie! You are correct as usual!